<style>
    .layui-form-item label {
        width: 120px;
    }
</style>
<div class="layui-card" style="padding:10px;">
    <div class="layui-tab">
        <ul class="layui-tab-title">
            <li class="layui-this">网站信息</li>
            <li>邮件发送设置</li>
            <li>第三方代码</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form seller-alone-form" action="" method="post">
                    <div class="layui-form-item">
                        <label class="layui-form-label">{$data['website_name']['name']}：</label>
                        <div class="layui-input-inline seller-inline-6">
                            <input type="text" name="website_name" value="{$data['website_name']['value']}" lay-verify="title" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">企业网站名称</div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">{$data['website_address']['name']}：</label>
                        <div class="layui-input-inline seller-inline-6">
                            <input type="text" name="website_address" value="{$data['website_address']['value']}" lay-verify="title" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">企业详细地址</div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">{$data['website_location']['name']}：</label>
                        <div class="layui-input-inline seller-inline-6">
                            <input type="text" name="website_location" value="{$data['website_location']['value']}" lay-verify="title" autocomplete="off" class="layui-input" placeholder="请选择公司具体坐标位置" readonly="readonly" onclick="showMap();">
                        </div>
                        <div class="layui-form-mid layui-word-aux">企业地址坐标</div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">{$data['website_copyright']['name']}：</label>
                        <div class="layui-input-inline seller-inline-6">
                            <input type="text" name="website_copyright" value="{$data['website_copyright']['value']}" lay-verify="title" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">企业版权信息 '|' 换行展示</div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">{$data['website_contact']['name']}：</label>
                        <div class="layui-input-inline seller-inline-6">
                            <input type="text" name="website_contact" value="{$data['website_contact']['value']}" lay-verify="title" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">企业联系方式</div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">{$data['website_mail']['name']}：</label>
                        <div class="layui-input-inline seller-inline-6">
                            <input type="text" name="website_mail" value="{$data['website_mail']['value']}" lay-verify="title" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">企业邮箱</div>
                    </div>

                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">{$data['website_description']['name']}：</label>
                        <div class="layui-input-block">
                            <textarea name="website_description" placeholder="网站详细介绍" class="layui-textarea" style="width: 30%">{$data['website_description']['value']}</textarea>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">&nbsp;</label>
                        <div class="layui-input-block">
                            <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="save" style="height: 37px;padding: 0 27px;font-size: 14px;">保存</button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="layui-tab-item">
                <form class="layui-form seller-alone-form" action="" method="post">
                    <!--<div class="layui-form-item">-->
                    <!--<label class="layui-form-label">合从客服appid：</label>-->
                    <!--<div class="layui-input-inline seller-inline-2">-->
                    <!--<input type="text" name="hecong_appid" value="{$data['hecong_appid']['value']}" lay-verify="title" autocomplete="off"  class="layui-input" style="width: 170px;">-->
                    <!--</div>-->
                    <!--</div>-->

                    <!--<div class="layui-form-item">-->
                    <!--<label class="layui-form-label">合从客服appkey：</label>-->
                    <!--<div class="layui-input-inline seller-inline-2">-->
                    <!--<input type="text" name="hecong_appkey" value="{$data['hecong_appkey']['value']}" lay-verify="title" autocomplete="off" class="layui-input" style="width: 170px;">-->
                    <!--</div>-->
                    <!--</div>-->
                    <div class="layui-form-item">
                        <label class="layui-form-label">&nbsp;</label>
                        <div class="layui-input-block">
                            <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="save" style="height: 37px;padding: 0 27px;font-size: 14px;">保存</button>
                        </div>
                    </div>

                </form>
            </div>
            <div class="layui-form-item">
                <form action=""></form>
            </div>
        </div>
    </div>
</div>

<script>
    layui.use(['form', 'layer'], function() {
        var form = layui.form,
            layer = layui.layer;
        //保存商品
        form.on('submit(save)', function(data) {
            formData = data.field;
            if (!formData) {
                layer.msg('请先完善数据', {
                    time: 1300
                }); //layer.msg(JSON.stringify(data.field));
                return false;
            }
            $.ajax({
                url: '{:url("Setting/index")}',
                type: 'post',
                data: formData,
                dataType: 'json',
                success: function(e) {
                    if (e.status === true) {
                        layer.msg('保存成功');
                    } else {
                        layer.msg(e.msg, {
                            time: 1300
                        });
                    }
                }
            });
            return false;
        });
    });

    function showMap() {
        window.box = layer.open({
            type: 2,
            title: '选择坐标位置',
            area: ['750px', '650px'],
            content: "{:url('Setting/showMap')}?location=" + $("input[name=website_location]").val()
        })
    }
</script>